/**
 * Created by sanfast6 on 2016/3/9.
 */
$(function () {
    var Media =  $(".video")[0];
    $(".start-icon").click(function () {
        $(this).hide();
        $(".video").attr("controls","controls");
        Media.play();
    })
    var eventTester = function(e){
        Media.addEventListener(e,function(){
            if(e == "pause") {
                if($(".video").width() < 300) {
                    $(".start-icon").show();
                }
            }
            if(e == "play") {
                $(".start-icon").hide();
            }
        });
    }
    eventTester("pause");
    eventTester("play");
})
